﻿using System.Collections;
using System.Collections.Generic;
using System;
/*
消息体
直接遍历
key访问 message[key]
send()
remove()
add()
构造函数参数=》sender type(name) content
*/

public class Message
{
    private object[] objs;
    public string Name { get; private set; }
    //索引器 实现
    public object this[int key]
    {
        get
        {
            return objs[key];
        }
        set
        {
            objs[key] = value;
        }
    }

    public Message(string name, params object[] objs)
    {
        Name = name;
        this.objs = objs;
    }

    //send
    public void Send()
    {
        EventMgr.Instance.dispatch(this);
    }

}